const app = getApp();
Page({
  data: {
    message:{},
    activeNames: ['1'],
  },
  onChange(event) {
    this.setData({
      activeNames: event.detail
    });
    // console.log(event)
  },
  onShow:function(){
    var that=this
    var allID=that.data.allID
    wx.cloud.callFunction({
      name:"get_student-pro",
      data:{
        allID:allID
      }
    }).then(res=>{
      that.setData({
        message:res.result
      })
    })
  },
  onLoad: function (options) {
    this.setData({
      allID:options.allID
    })
  },
  btn:function(){
    // console.log(this.data)
    var allID=this.data.allID
    wx.navigateTo({
      url: '/pages/provisional/provisional?allID='+allID,
    })
  },
  delet:function(e){
    var phone=e.currentTarget.dataset.id.phone
    console.log(e.currentTarget.dataset.id.phone)
    wx.cloud.callFunction({
      name:"pro-delet-mess",
      data:{
        phone:phone
      }
    }).then(res=>{
      wx.showToast({
        title: '成功,下拉刷新',
        icon:"success"
      })
    })
  },
  more:function(e){
    console.log(e.currentTarget.dataset.id)
    var phone=e.currentTarget.dataset.id.phone
    wx.navigateTo({
      url: '../pro-change/pro-change?phone='+phone,
    })
  },
  onPullDownRefresh: function () {
    wx.showNavigationBarLoading()
    this.onShow()
    setTimeout(() => {
      wx.hideNavigationBarLoading()
      wx.stopPullDownRefresh()
    }, 1000);
  },

})